<?php

namespace App\Listener;

use App\Events\AgentCreated;
use App\Repository\Agent\AgentRepository;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;

class AgentQrcode implements ShouldQueue
{
    protected $agentRepository;
    /**
     * Create the event listener.
     *
     * @return void
     */
    public function __construct(AgentRepository $agentRepository)
    {
        $this->agentRepository=$agentRepository;
    }

    /**
     * Handle the event.
     *
     * @param  AgentCreated  $event
     * @return void
     */
    public function handle(AgentCreated $event)
    {

        $this->agentRepository->getQrcode($event->agent);

    }
}
